package com.ruoyi.web.exams.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
        import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.web.exams.service.IExamOptionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.web.exams.mapper.ExamOptionMapper;
import com.ruoyi.web.exams.domain.ExamOption;

/**
 * 选项Service业务层处理
 *
 * @author 范书铭
 * @date 2024-10-02
 */
@Service
public class ExamOptionServiceImpl extends ServiceImpl<ExamOptionMapper, ExamOption> implements IExamOptionService {
    @Autowired
    private ExamOptionMapper examOptionMapper;

    /**
     * 查询选项
     *
     * @param id 选项主键
     * @return 选项
     */
    @Override
    public ExamOption selectExamOptionById(Long id) {
        return examOptionMapper.selectExamOptionById(id);
    }

    /**
     * 查询选项列表
     *
     * @param examOption 选项
     * @return 选项
     */
    @Override
    public List<ExamOption> selectExamOptionList(ExamOption examOption) {
        return examOptionMapper.selectExamOptionList(examOption);
    }

    /**
     * 新增选项
     *
     * @param examOption 选项
     * @return 结果
     */
    @Override
    public int insertExamOption(ExamOption examOption) {
                examOption.setCreateTime(DateUtils.getNowDate());
            return examOptionMapper.insertExamOption(examOption);
    }

    /**
     * 修改选项
     *
     * @param examOption 选项
     * @return 结果
     */
    @Override
    public int updateExamOption(ExamOption examOption) {
                examOption.setUpdateTime(DateUtils.getNowDate());
        return examOptionMapper.updateExamOption(examOption);
    }

    /**
     * 批量删除选项
     *
     * @param ids 需要删除的选项主键
     * @return 结果
     */
    @Override
    public int deleteExamOptionByIds(Long[] ids) {
        return examOptionMapper.deleteExamOptionByIds(ids);
    }

    /**
     * 删除选项信息
     *
     * @param id 选项主键
     * @return 结果
     */
    @Override
    public int deleteExamOptionById(Long id) {
        return examOptionMapper.deleteExamOptionById(id);
    }
}